package com.example.mapper;

import com.example.entity.User;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface UserMapper {

    int insert(User user);

    int deleteById(Integer id);

    User selectById(Integer id);

    List<User> selectAll(User user);

    @Select("select * from `user` where username = #{username}")
    User selectByUsername(String username);

    int updateById(User user);
}
